#include <string>
#include <iostream>
#include "stdafx.h"
using namespace std;

bool isSubstring(string first, string second)
{
	auto ret= first.find(second);
	if(ret == string::npos)
		return false;
	else
		return true;
}

bool isRotatedString(string first, string second)
{
	if(first.length() != second.length())
		return false;
	string tmp = second + second;
	return isSubstring(tmp, first);
}

#ifdef RUN_1_1
int main()
{
	string first, second;
	cout << "First String: " ;
	cin >> first;
	cout << "Second String: ";
	cin >> second;
	
	if(isRotatedString(first, second))
		cout << "True" << endl;
	else
		cout << "False" << endl;
	
}
#endif